package com.sylli.oeuf.server.object.transferable;



public class CharacterGeneralInfoTO extends BasedTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5755019701207144811L;
	
	private int charId;
	
	private int accountId;
	
	private String name;
	
	private int clazzId;

	private StatTO stat;
	
	private int maxHp;
	
	private int maxMp;
	
	private int level;
	
	private int maxExp;
	
	private LevelUpTO levelUp;
	
	private StrategyBundleTO strategyBundle;
	
	private SkillBundleTO skillBundle;
	
	public CharacterGeneralInfoTO() {
		strategyBundle = new StrategyBundleTO();
	}

	@Override
	public String toString() {
		return "Char-GenInfo: charId=" + charId
			+ ", accountId=" + accountId
			+ ", name="+ name
			+ ", classId=" + clazzId
			+ ", stat=" + stat
			+ ", maxHp=" + maxHp
			+ ", maxMp=" + maxMp
			+ ", level=" + level
			+ ", maxExp=" + maxExp
			+ ", strategyBundle=" + strategyBundle;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof CharacterGeneralInfoTO) {
			CharacterGeneralInfoTO cgi = (CharacterGeneralInfoTO) obj;
			return cgi.charId == charId
				&& cgi.accountId == accountId
				&& cgi.name.equals(name)
				&& cgi.clazzId == clazzId
				&& cgi.stat.equals(stat)
				&& cgi.maxHp == maxHp
				&& cgi.maxMp == maxMp
				&& cgi.level == level
				&& cgi.maxExp == maxExp
				&& cgi.strategyBundle == strategyBundle;
		}
		return false;
	}

	public int getCharId() {
		return charId;
	}

	public void setCharId(int charId) {
		this.charId = charId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getClazzId() {
		return clazzId;
	}

	public void setClazzId(int classId) {
		this.clazzId = classId;
	}

	public int getMaxExp() {
		return maxExp;
	}

	public void setMaxExp(int maxExp) {
		this.maxExp = maxExp;
	}

	public int getAccountId() {
		return accountId;
	}

	public void setAccountId(int accountId) {
		this.accountId = accountId;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getMaxHp() {
		return maxHp;
	}

	public void setMaxHp(int maxHp) {
		this.maxHp = maxHp;
	}

	public int getMaxMp() {
		return maxMp;
	}

	public void setMaxMp(int maxMp) {
		this.maxMp = maxMp;
	}

	public StatTO getStat() {
		return stat;
	}

	public void setStat(StatTO stat) {
		this.stat = stat;
	}

	public StrategyBundleTO getStrategyBundle() {
		return strategyBundle;
	}

	public void setStrategyBundle(StrategyBundleTO strategyBundle) {
		this.strategyBundle = strategyBundle;
	}
	
	public StrategyTO findStrategy(int id) {
		for (StrategyTO sto : strategyBundle.getBundle()) {
			if (sto.getStrategyId() == id) {
				return sto;
			}
		}
		return null;
	}

	public LevelUpTO getLevelUp() {
		if (levelUp == null) {
			levelUp = new LevelUpTO();
		}
		return levelUp;
	}

	public void setLevelUp(LevelUpTO levelUp) {
		this.levelUp = levelUp;
	}

	public SkillBundleTO getSkillBundle() {
		return skillBundle;
	}

	public void setSkillBundle(SkillBundleTO skillBundle) {
		this.skillBundle = skillBundle;
	}
}
